<?php
namespace Util;
class Javascript{

    const SERVER_ERROR = "服务器开小差~错误信息为：";
    /**
     * @param string $massage
     */
    public static function jsLayerMsg($massage='未知错误')
    {
        $script = '<script type="text/javascript">';
        $script .= 'layer.msg("'.$massage.'");';
        $script .= '</script>';
        echo $script;
    }

    /**
     * @param string $massage
     */
    public static function jsAlert($massage='未知错误',$redict_url= '.')
    {
        $script = '<script type="text/javascript">';
        $script .= 'alert("'.$massage.'");';
        if($redict_url != '') {
            $script .= 'window.location.href = "'.$redict_url.'";';
        }
        $script .= '</script>';
        echo $script;
    }/**
     * @param string $massage
     */
    public static function jsHistoryBack()
    {
        $script = '<script type="text/javascript">';
        $script .= 'history.back();';
        $script .= '</script>';
        echo $script;
    }
}